/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/memory
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEContainerTempAllocator.h
// Author:		Gianluca Belardelli
// Date:		18/04/2014
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AECONTAINERTEMPALLOCATOR_H_
#define _AECONTAINERTEMPALLOCATOR_H_

struct AE_COREDLLIMPEXP AEContainerTempAllocator
{
	AE_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( TOBEDEFINED, AEContainerTempAllocator );
	
	struct AEAllocator : public AEMemoryAllocator
	{
		AE_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR( TOBEDEFINED, AEAllocator);
		
		virtual void *BlockAlloc( AEUINT32 uiNumBytes, AEMemoryAlign maAlign = AEMEM_ALIGN16 );
		virtual void BlockFree( void *lpPtr, AEUINT32 uiNumBytes );
		virtual void *BufAlloc( AEINT32 &nReqNumBytesInOut );
		virtual void BufFree( void *lpPtr, AEINT32 nNumBytes );
		virtual void *BufRealloc( void *lpOldPtr, AEINT32 nOldNumBytes, AEINT32 &nReqNumBytesInOut );
		virtual void GetMemoryStats( AEMemStats &msStats );
		virtual AEINT32 GetAllocatedSize( const void *lpObj, AEINT32 nBytes );
	};

	static AEAllocator ms_aAllocator;
	AEMemoryAllocator &Get( const void * ) { return ms_aAllocator; }
};

#endif // _AECONTAINERTEMPALLOCATOR_H_
